home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / kupidon-strike.swf / scripts / frame_245 / PlaceObject3_264_41 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2011-12-21  |  2.0 KB  |  55 lines

  1. onClipEvent(enterFrame){
  2.    if(move_delay >= 0)
  3.    {
  4.       move_delay--;
  5.    }
  6.    if(this.moveble && move_delay < 0)
  7.    {
  8.       if(c_path <= 0)
  9.       {
  10.          move_direction = -1;
  11.       }
  12.       if(c_path >= move_path)
  13.       {
  14.          move_direction = 1;
  15.       }
  16.       if(move_direction == 1)
  17.       {
  18.          c_path -= move_speed;
  19.          _X = _X + move_speed * Math.sin(move_angle * 0.017453292519943295);
  20.          _Y = _Y - move_speed * Math.cos(move_angle * 0.017453292519943295);
  21.       }
  22.       if(move_direction == -1)
  23.       {
  24.          c_path += move_speed;
  25.          _X = _X - move_speed * Math.sin(move_angle * 0.017453292519943295);
  26.          _Y = _Y + move_speed * Math.cos(move_angle * 0.017453292519943295);
  27.       }
  28.    }
  29.    if(this.active && to)
  30.    {
  31.       if(this.hitTest(_root.bullet._x,_root.bullet._y,true) or this.hitTest(_root.bullet._x - 10 * Math.sin(_root.bullet._rotation * 0.017453292519943295),_root.bullet._y + 10 * Math.cos(_root.bullet._rotation * 0.017453292519943295),true) or this.hitTest(_root.bullet._x - 20 * Math.sin(_root.bullet._rotation * 0.017453292519943295),_root.bullet._y + 20 * Math.cos(_root.bullet._rotation * 0.017453292519943295),true))
  32.       {
  33.          _root.spark(_X + _root.half_heart,_Y + _root.half_heart,Obj._x + _root.half_heart,Obj._y + _root.half_heart);
  34.          _root.do_sound("sHeart-port",true);
  35.          _root.boom(_X,_Y,"black",35);
  36.          rea();
  37.       }
  38.       i = 0;
  39.       while(i < _root.tohit.length)
  40.       {
  41.          if(this.active && _root[_root.tohit[i]].active && this.hitTest(_root[_root.tohit[i]]._x,_root[_root.tohit[i]]._y,true))
  42.          {
  43.             _root.do_sound("sHeart-port",true);
  44.             _root.boom(_X,_Y,"black",35);
  45.             Obj.to = false;
  46.             _root[_root.tohit[i]]._x = Obj._x + 13;
  47.             _root[_root.tohit[i]]._y = Obj._y + 53;
  48.             setTimeout(Obj.set_to,100);
  49.             _root.boom(Obj._x,Obj._y,"black",35);
  50.          }
  51.          i++;
  52.       }
  53.    }
  54. }
  55.